package com.itheima.课件.otherstream.convertedio;


import java.io.*;

public class ConvertedDemo2 {
    public static void main(String[] args) throws IOException {
        User user = new User("zhangsan","qwer");

        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("day13_字符流&properties\\d.txt"));
        oos.writeObject(user);
        oos.close();

        //需求:把这个用户信息保存到本地文件去.
       /* BufferedWriter bw = new BufferedWriter(new FileWriter("a.txt"));
        bw.write(user.getUsername());
        bw.newLine();
        bw.write(user.getPassword());
        bw.close();*/
    }
}
